package com.logic.system.ws.dto;

import com.logic.common.ws.dto.system.NotificationDTO;
import com.logic.system.domain.Notification;

/**
 * Author: omer 
 * Date  : 19-01-2016
 */
public class NotificationConverter {

    public static NotificationDTO fromNotificationToNotificationDTO(Notification notification){
        NotificationDTO notificationDTO = new NotificationDTO();

        notificationDTO.setId(notification.getId());
        notificationDTO.setSend_to(notification.getSendTo());
        notificationDTO.setContent(notification.getContent());
        notificationDTO.setTitle(notification.getTitle());
//        notificationDTO.setSend_date(notification.getSentDtm());
        notificationDTO.setSent_result(notification.getSentResult());
        notificationDTO.setStatus(notification.getStatus());
//
        notificationDTO.setNoti_scope(notification.getNotiScope());
        notificationDTO.setNoti_type(notification.getNotiType());
        notificationDTO.setCreated_by_id(notification.getCreatedBy());
        notificationDTO.setUpdate_date(notification.getLastModifiedDtm());

        return notificationDTO;
    }

    public static Notification fromNotificationDTOToNotification(NotificationDTO notificationDTO){
        Notification notification = new Notification();

        notification.setId(notificationDTO.getId());
        notification.setSendTo(notificationDTO.getSend_to());
        notification.setContent(notificationDTO.getContent());
        notification.setTitle(notificationDTO.getTitle());
//        notification.setSentDtm(notificationDTO.getSend_date());
        notification.setSendTo(notificationDTO.getSend_to());
        notification.setSentResult(notificationDTO.getSent_result());
        notification.setStatus(notificationDTO.getStatus());

        notification.setNotiType(notificationDTO.getNoti_type());
        notification.setNotiScope(notificationDTO.getNoti_scope());

        return notification;
    }

}
